<template>
  <div class="init_main">
    <p class="name_sty">{{ name }}</p>
    <div class="query">
      质控类型：
      <el-select
        v-model="query.filter.qcLevel"
        placeholder=""
        size="mini"
        @change="getQX"
      >
        <el-option label="一级质控流程" :value="1"> </el-option>
        <!-- <el-option label="二级质控流程" :value="2"> </el-option> -->
        <el-option label="二级质控流程" :value="4"> </el-option>
      </el-select>
      任务名称：
      <el-input
        v-model="query.filter.Name"
        placeholder=""
        size="mini"
        style="width: 150px"
      ></el-input>
      <!-- 质控类型：
      <el-select v-model="query.value" placeholder="" size="mini">
        <el-option label="全部" value="全部"> </el-option>
      </el-select>
      模板组：
      <el-select v-model="query.value" placeholder="" size="mini">
        <el-option label="全部" value="全部"> </el-option>
      </el-select>
      检查组：
      <el-select v-model="query.value" placeholder="" size="mini">
        <el-option label="全部" value="全部"> </el-option>
      </el-select>
      <p></p>
      周期：
      <el-select v-model="query.value" placeholder="" size="mini">
        <el-option label="全部" value="全部"> </el-option>
      </el-select>
      年份：
      <el-select v-model="query.value" placeholder="" size="mini">
        <el-option label="全部" value="全部"> </el-option>
      </el-select> -->
      机构：
      <el-cascader
        size="mini"
        :options="OrganTree"
        :props="{
          checkStrictly: true,
          value: 'Id',
          label: 'Name',
          children: 'Children',
        }"
        clearable
        v-model="CheckHospitalId"
        @change="
          query.filter.CheckHospitalId =
            CheckHospitalId[CheckHospitalId.length - 1]
        "
      ></el-cascader>

      <el-button
        plain
        size="mini"
        icon="el-icon-search"
        style="margin-left: 10px"
        @click="getList"
        :disabled="userQX.查询"
        >查询</el-button
      >
      <el-button
        plain
        size="mini"
        icon="el-icon-plus"
        type="primary"
        @click="open_dialog('新增')"
        :disabled="userQX.新增"
        >新增</el-button
      >
      <el-button plain size="mini" type="primary" @click="open_dialog('发布')"
        >发布</el-button
      >
      <el-button
        plain
        size="mini"
        type="danger"
        @click="open_dialog('取消发布')"
        >取消发布</el-button
      >
      <el-button
        plain
        size="mini"
        icon="el-icon-edit"
        type="warning"
        @click="open_dialog('修改')"
        >修改</el-button
      >
      <el-button
        plain
        size="mini"
        icon="el-icon-delete"
        type="danger"
        @click="del_row"
        :disabled="userQX.删除"
        >删除</el-button
      >
    </div>
    <div class="table" v-if="isShow && query.filter.qcLevel == 1">
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        height="600"
        highlight-current-row
        @current-change="row_click"
      >
        <el-table-column prop="Name" label="任务名称"> </el-table-column>
        <el-table-column prop="CheckGroupName" label="检查组">
        </el-table-column>
        <el-table-column label="成员">
          <template slot-scope="scope">
            <span
              v-for="(item, index) in scope.row.Users"
              :key="index"
              :style="item.UserTyoe == 1 ? 'color:red' : ''"
              >{{ item.UserName }}
            </span>
          </template>
        </el-table-column>
        <el-table-column prop="CheckSectionName" label="调查科室">
        </el-table-column>
        <el-table-column prop="Status" label="检查进度">
          <template slot-scope="scope">
            {{ scope.row.Status | toStatus }}
          </template>
        </el-table-column>
        <el-table-column prop="TemplateGroupName" label="模板组">
        </el-table-column>
        <el-table-column prop="TemplateName" label="模板名称">
        </el-table-column>
        <el-table-column prop="PeriodType" label="检查周期">
          <template slot-scope="scope">
            <span>{{ scope.row.PeriodType | PeriodType_tostr }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="InvestigatorCount" label="调查份数">
        </el-table-column> -->
        <el-table-column prop="PlanTime" label="计划执行时间">
        </el-table-column>
        <el-table-column prop="StartTime" label="开始时间"> </el-table-column>
        <el-table-column prop="EndTime" label="结束时间"> </el-table-column>
        <el-table-column prop="InvestigatorType" label="被调查者类型">
        </el-table-column>
      </el-table>
    </div>
    <div class="table" v-if="isShow && query.filter.qcLevel == 4">
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        height="600"
        highlight-current-row
        @current-change="row_click"
        @expand-change="handleExpandChange"
        :expand-row-keys="expand_key"
        row-key="TaskGroupId"
      >
        <el-table-column type="expand">
          <el-table
            :data="tableData2"
            border
            style="width: 100%"
            highlight-current-row
            @current-change="row_click"
          >
            <el-table-column prop="操作" label="操作">
              <template slot-scope="scope">
                <span style="color: blue"
                  ><el-button
                    type="text"
                    @click="to_Ti(scope.row)"
                    v-if="scope.row.DoneCount != scope.row.InvestigatorCount"
                    >填写</el-button
                  >
                  <el-button type="text" @click="to_Ti2(scope.row)" v-else
                    >查看</el-button
                  >
                </span>
              </template>
            </el-table-column>
            <el-table-column prop="" label="进度">
              <template slot-scope="scope">
                {{ scope.row.DoneCount }} / {{ scope.row.InvestigatorCount }}
              </template>
            </el-table-column>
            <el-table-column prop="Name" label="任务名称"> </el-table-column>
            <el-table-column prop="CheckGroupName" label="检查组">
            </el-table-column>
            <el-table-column prop="CheckSectionName" label="调查科室">
            </el-table-column>
            <el-table-column prop="Status" label="状态">
              <template slot-scope="scope">
                {{ scope.row.Status | toStatus }}
              </template>
            </el-table-column>
            <el-table-column prop="TemplateGroupName" label="模板组">
            </el-table-column>
            <el-table-column prop="TemplateName" label="模板名称">
            </el-table-column>
            <el-table-column prop="PeriodType" label="检查周期">
              <template slot-scope="scope">
                <span>{{ scope.row.PeriodType | PeriodType_tostr }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="InvestigatorCount" label="调查份数">
            </el-table-column>
            <el-table-column prop="PlanTime" label="计划执行时间">
            </el-table-column>
            <el-table-column prop="StartTime" label="开始时间">
            </el-table-column>
            <el-table-column prop="EndTime" label="结束时间"> </el-table-column>
            <el-table-column prop="InvestigatorType" label="被调查者类型">
            </el-table-column>
          </el-table>
        </el-table-column>
        <el-table-column prop="Name" label="任务名称"> </el-table-column>
        <el-table-column prop="CheckGroupName" label="检查组">
        </el-table-column>
        <el-table-column label="成员">
          <template slot-scope="scope">
            <span
              v-for="(item, index) in scope.row.Users"
              :key="index"
              :style="item.UserTyoe == 1 ? 'color:red' : ''"
              >{{ item.UserName }}
            </span>
          </template>
        </el-table-column>
        <el-table-column prop="CheckSectionName" label="调查科室">
        </el-table-column>
        <el-table-column prop="Status" label="检查进度">
          <template slot-scope="scope">
            {{ scope.row.Status | toStatus }}
          </template>
        </el-table-column>
        <el-table-column prop="TemplateGroupName" label="模板组">
        </el-table-column>
        <el-table-column prop="TemplateName" label="模板名称">
        </el-table-column>
        <el-table-column prop="PeriodType" label="检查周期">
          <template slot-scope="scope">
            <span>{{ scope.row.PeriodType | PeriodType_tostr }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column prop="InvestigatorCount" label="调查份数">
        </el-table-column> -->
        <el-table-column prop="PlanTime" label="计划执行时间">
        </el-table-column>
        <el-table-column prop="StartTime" label="开始时间"> </el-table-column>
        <el-table-column prop="EndTime" label="结束时间"> </el-table-column>
        <el-table-column prop="InvestigatorType" label="被调查者类型">
        </el-table-column>
      </el-table>
    </div>
    <div class="page">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange_page"
        :current-page="query.CurrentPage"
        :page-sizes="[10, 15, 50, 100]"
        :page-size="query.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="query.total"
      >
      </el-pagination>
    </div>
    <!-- 弹层 -->
    <el-dialog
      :title="dialog_title"
      :visible.sync="dialogVisible"
      width="45%"
      :before-close="handleClose"
      :append-to-body="true"
      :close-on-click-modal="false"
    >
      <table border="1" style="width: 100%">
        <tr>
          <td class="tac">任务名称：</td>
          <td><el-input size="mini" v-model="form.Name"></el-input></td>
          <td class="tac">质控类型：</td>
          <td>
            <el-select
              v-model="form.QcLevel"
              placeholder=""
              size="mini"
              style="width: 100%"
              @change="(form.CheckSectionId = []), getks()"
            >
              <el-option label="一级质控" :value="1"> </el-option>
              <!-- <el-option label="二级质控" value="2"> </el-option> -->
              <el-option label="二级质控" :value="4"> </el-option>
              <!-- <el-option label="一级、二级质控" value="3"> </el-option>
              <el-option label="一级、三级质控" value="5"> </el-option>
              <el-option label="二级、三级质控" value="6"> </el-option>
              <el-option label="一级、二级、三级质控" value="7"> </el-option> -->
            </el-select>
          </td>
        </tr>
        <tr>
          <td class="tac">模板组：</td>
          <td>
            <el-select
              v-model="form.TemplateGroupId"
              placeholder=""
              size="mini"
              style="width: 100%"
              @change="get_option_2"
            >
              <el-option
                v-for="item in 模板组"
                :key="item.Id"
                :label="item.Name"
                :value="item.Id"
              >
              </el-option>
            </el-select>
          </td>
          <td class="tac">模板名称：</td>
          <td>
            <el-select
              v-model="form.TemplateId"
              placeholder=""
              size="mini"
              style="width: 100%"
            >
              <el-option
                v-for="item in 版本组"
                :key="item.Id"
                :label="item.Name"
                :value="item.Id"
              >
              </el-option>
            </el-select>
          </td>
        </tr>
        <tr>
          <td class="tac">检查周期：</td>
          <td>
            <el-select
              v-model="form.PeriodType"
              placeholder=""
              size="mini"
              style="width: 100%"
            >
              <el-option label="月" :value="4"> </el-option>
              <el-option label="周" :value="5"> </el-option>
            </el-select>
          </td>
          <td class="tac">被调查类型：</td>
          <td>
            <el-select
              v-model="form.InvestigatorType"
              placeholder=""
              size="mini"
              style="width: 100%"
            >
              <!-- <el-option label="患者" value="患者"> </el-option> -->
              <!-- <el-option label="护士" value="护士"> </el-option> -->
              <el-option label="科室" value="科室"> </el-option>
            </el-select>
          </td>
        </tr>
        <tr>
          <td class="tac">周期值：</td>
          <td>
            <el-date-picker
              :picker-options="{ firstDayOfWeek: 1 }"
              v-if="form.PeriodType == '5'"
              v-model="form.PeriodNode"
              size="mini"
              type="week"
              format="yyyy 第 WW 周"
              style="width: 100%"
              placeholder="选择周"
              @change="setWeek"
            >
            </el-date-picker>
            <el-date-picker
              v-else
              @change="setMon"
              v-model="form.PeriodNode"
              size="mini"
              type="month"
              style="width: 100%"
              placeholder="选择月"
              value-format="yyyy-MM"
            >
            </el-date-picker>
          </td>
          <td class="tac">调查科室：</td>
          <td>
            <!-- <el-input size="mini" v-model="form.checkSectionName"></el-input> -->
            <el-select
              v-if="form.QcLevel == 4"
              v-model="form.CheckSectionId"
              multiple
              collapse-tags
              size="mini"
              style="width: 100%"
              placeholder="请选择"
            >
              <el-option
                v-for="item in ksList"
                :key="item.Id"
                :label="item.Name"
                :value="item.Id + ''"
              >
              </el-option>
            </el-select>
            <el-select
              v-else
              v-model="form.CheckSectionId"
              size="mini"
              style="width: 100%"
              placeholder="请选择"
            >
              <el-option
                v-for="item in ksList"
                :key="item.Id"
                :label="item.Name"
                :value="item.Id + ''"
              >
              </el-option>
            </el-select>
          </td>
        </tr>
        <tr>
          <td class="tac">开始日期：</td>
          <td>
            <el-date-picker
              v-model="form.StartTime"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="datetime"
              size="small"
              placeholder="选择日期"
              style="width: 100%"
            >
            </el-date-picker>
          </td>
          <td class="tac">结束日期：</td>
          <td>
            <el-date-picker
              v-model="form.EndTime"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="datetime"
              size="small"
              placeholder="选择日期"
              style="width: 100%"
            >
            </el-date-picker>
          </td>
        </tr>
        <tr>
          <td class="tac">计划时间：</td>
          <td>
            <el-date-picker
              v-model="form.PlanTime"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="datetime"
              size="small"
              placeholder="选择日期"
              style="width: 100%"
            >
            </el-date-picker>
          </td>
          <td class="tac">调查份数：</td>
          <td>
            <el-input size="mini" v-model="form.InvestigatorCount"></el-input>
          </td>
        </tr>
        <tr>
          <td class="tac">检查组：</td>
          <td colspan="3">
            <el-select
              v-model="form.CheckGroupId"
              placeholder=""
              size="mini"
              style="width: 100%"
              @change="user_total"
            >
              <el-option
                v-for="item in 质控组"
                :key="item.Id"
                :label="item.Name"
                :value="item.Id"
              >
              </el-option>
            </el-select>
          </td>
        </tr>
        <tr>
          <td class="tac">机构：</td>
          <td colspan="3">
            <el-cascader
              style="width: 100%"
              size="mini"
              :options="OrganTree"
              :props="{
                checkStrictly: true,
                value: 'Id',
                label: 'Name',
                children: 'Children',
              }"
              clearable
              v-model="form.CheckHospitalId"
              @change="
                form.CheckHospitalId =
                  form.CheckHospitalId[form.CheckHospitalId.length - 1]
              "
            ></el-cascader>
          </td>
        </tr>
      </table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose" size="mini">关 闭</el-button>
        <el-button type="primary" @click="btn_ok" size="mini">保 存</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "",
      query: {
        CurrentPage: 1,
        pageSize: 10,
        total: 0,
        filter: {
          SystemCategory: "质量检查",
          CheckHospitalId: window.localStorage.getItem("hospitalId"),
          qcLevel: 1,
          menuName: "任务设置",
        },
      },
      tableData: [],
      dialogVisible: false,
      dialog_title: "",
      row_info: null,
      form: {
        CheckHospitalId: window.localStorage.getItem("hospitalId"),
        StartTime: "",
        EndTime: "",
        PlanTime: "",
        InvestigatorCount: "",
        CheckSectionId: [],
        PeriodNode: "",
      },
      模板组: [],
      质控组: [],
      版本组: [],
      OrganTree: [],
      CheckHospitalId: window.localStorage.getItem("hospitalId"),
      userQX: {},
      ksList: [],
      isShow: true,
      expand_key: [],
      tableData2: [],
    };
  },
  mounted() {
    this.name = this.$route.meta.title;
    this.getOptions();
    this.getQX();
    this.getOrgan();
    // this.getks();
  },
  filters: {
    toStatus(val) {
      var str = "";
      if (val == 0) {
        str = "未发布";
      }
      if (val == 1) {
        str = "开始调查";
      }
      if (val == 10) {
        str = "继续调查";
      }
      if (val == 20) {
        str = "待提交";
      }
      if (val == 30) {
        str = "审核提交";
      }
      if (val == 31) {
        str = "整改措施";
      }
      if (val == 32) {
        str = "病区跟踪检查";
      }
      if (val == 33) {
        str = "护理部跟踪检查";
      }
      if (val == 40) {
        str = "完成";
      }
      if (val == 41) {
        str = "审核下发";
      }
      if (val == 42) {
        str = "原因分析";
      }
      return str;
    },
    PeriodType_tostr(val) {
      var str = "";
      if (val == 4) {
        str = "月";
      }
      if (val == 5) {
        str = "周";
      }
      return str;
    },
  },
  methods: {
    getQX() {
      this.isShow = false;
      this.$get(
        "/Task/GetPermission/" + this.query.filter.qcLevel + "/任务设置"
      ).then((res) => {
        var list = res.Data;
        var data = {
          查询: true,
          新增: true,
          修改: true,
          删除: true,
        };
        this.tableData = [];
        this.query.total = 0;
        for (var item in list) {
          if (list[item] == "查看") {
            data.查询 = false;
            this.getList();
          }
          if (list[item] == "新增") {
            data.新增 = false;
          }
          if (list[item] == "编辑") {
            data.修改 = false;
          }
          if (list[item] == "删除") {
            data.删除 = false;
          }
        }
        this.userQX = data;
        this.isShow = true;
      });
    },
    getOrgan() {
      this.$get(
        "/Task/GetOrganTree?id=" + window.localStorage.getItem("hospitalId2")
      ).then((res) => {
        this.OrganTree = res.Data;
      });
    },
    setWeek(val) {
      // this.form.PeriodNode = this.getYearWeek(val);
      var thisweek = {};
      var date = val;
      // 本周一的日期
      date.setDate(date.getDate() - date.getDay() + 1);
      thisweek.start_day =
        date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();

      // 本周日的日期
      date.setDate(date.getDate() + 6);
      thisweek.end_day =
        date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
      this.form.StartTime = thisweek.start_day;
      this.form.EndTime = thisweek.end_day;
    },
    setMon(val) {
      var myArray = val.split("-");
      var lastDay = new Date(myArray[0], myArray[1], 0);
      var year = lastDay.getFullYear();
      var month = lastDay.getMonth() + 1;
      month = month < 10 ? "0" + month : month;
      var day = lastDay.getDate();
      day = day < 10 ? "0" + day : day;
      this.form.StartTime = val + "-1";
      this.form.EndTime = val + "-" + day;
      // this.form.PeriodNode = this.getYearWeek(val);
    },
    getYearWeek(endDate) {
      //本年的第一天
      var beginDate = new Date(endDate.getFullYear(), 0, 1);
      //星期从0-6,0代表星期天，6代表星期六
      var endWeek = endDate.getDay();
      if (endWeek == 0) endWeek = 7;
      var beginWeek = beginDate.getDay();
      if (beginWeek == 0) beginWeek = 7;
      //计算两个日期的天数差
      var millisDiff = endDate.getTime() - beginDate.getTime();
      var dayDiff = Math.floor(
        (millisDiff + (beginWeek - endWeek) * (24 * 60 * 60 * 1000)) / 86400000
      );
      var year = new Date().getFullYear();
      return year + " 第 " + (Math.ceil(dayDiff / 7) + 1) + " 周";
    },
    getks() {
      if (this.form.QcLevel == 1) {
        this.$get("/Bs/GetUserByToken").then((res) => {
          this.ksList = [
            {
              Id: res.Data.UserInfo.SectionId,
              Name: res.Data.UserInfo.SectionName,
            },
          ];
        });
      }
      if (this.form.QcLevel == 4) {
        this.$get("/Bs/GetSectionList").then((res) => {
          this.ksList = res.Data;
        });
      }
    },
    getList() {
      this.$post("/Task/GetPageListRepsonse", this.query).then((res) => {
        this.tableData = res.Data.PageList;
        this.query.total = res.Data.Total;
      });
    },
    getOptions() {
      var query = {
        CurrentPage: 1,
        pageSize: 999,
        filter: {
          SystemCategory: "质量检查",
        },
      };
      this.$post("/TemplateGroup/GetPageList", query).then((res) => {
        this.模板组 = res.Data.PageList;
      });
      this.$post("/CheckGroup/GetPageList", query).then((res) => {
        this.质控组 = res.Data.PageList;
      });
    },
    get_option_2(id) {
      var body = {
        currentPage: 1,
        pageSize: 999,
        filter: {
          hasDisable: true,
          orderByStr: "",
          groupId: id,
        },
      };
      this.$post("/Template/GetPageList", body).then((res) => {
        this.版本组 = res.Data.PageList;
      });
    },
    open_windo(url) {
      window.open(url);
    },
    row_click(row) {
      if (!row) {
        this.row_info = null;
        return;
      }
      this.row_info = row;
    },
    del_row() {
      if (this.row_info.Status != 0) {
        this.$notify.error({
          title: "失败",
          message: "无法删除已开始的任务!",
        });
        return;
      }
      this.$get("/Task/SoftDelete/" + this.row_info.Id).then((res) => {
        this.getList();
      });
    },
    handleClose() {
      (this.form = {
        CheckHospitalId: window.localStorage.getItem("hospitalId"),
        StartTime: "",
        EndTime: "",
        PlanTime: "",
        InvestigatorCount: "",
        CheckSectionId: [],
        PeriodNode: "",
      }),
        (this.CheckHospitalId = []);
      this.dialogVisible = false;
    },
    btn_ok() {
      if (this.form.CheckSectionId instanceof Array) {
        this.form.CheckSectionId = this.form.CheckSectionId.join(",");
      }
      if (this.dialog_title == "修改任务") {
        this.$put("/Task/UpdateNoPublish", this.form).then((res) => {
          this.getList();
          this.handleClose();
          return;
        });
        return;
      }
      this.form.SystemCategory = "质量检查";
      this.$post("/Task/CreateNoPublish", this.form).then((res) => {
        this.getList();
        this.handleClose();
      });
    },
    open_dialog(val) {
      this.dialog_title = val + "任务";
      if (val == "新增") {
        this.dialogVisible = true;

        return;
      }
      if (val == "修改" && this.row_info && this.row_info.Status == 0) {
        this.form = this.row_info;
        this.get_option_2(this.form.TemplateGroupId);
        this.dialogVisible = true;
        return;
      }
      if (val == "发布" && this.row_info) {
        this.$confirm("发布后无法修改, 是否继续?", "通知", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.$post("/Task/Publish/" + this.row_info.Id).then((res) => {
              this.getList();
              this.$notify({
                title: "成功",
                message: "发布成功！",
                type: "success",
              });
            });
            return;
          })
          .catch(() => {});
      }
      if (val == "取消发布" && this.row_info) {
        this.$confirm("已有任务进行中无法取消发布，是否继续?", "通知", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.$get("/Task/CancelPublish/" + this.row_info.Id).then((res) => {
              if (res.StatusCode == 200) {
                this.getList();
                this.$notify({
                  title: "成功",
                  message: "操作成功！",
                  type: "success",
                });
              } else {
                this.$notify.error({
                  title: "失败",
                  message: res.Errors,
                });
              }
            });
            return;
          })
          .catch(() => {});
      } else {
        this.$notify.error({
          title: "错误",
          message: "请选择一条数据或当前数据无法进行此操作！",
        });
        return;
      }
    },
    handleSizeChange(val) {
      this.query.pageSize = val;
      this.query.CurrentPage = 1;
    },
    handleCurrentChange_page(val) {
      this.query.CurrentPage = val;
      this.getList();
    },
    user_total(val) {
      return;
      for (var i in this.质控组) {
        if (val == this.质控组[i].Id) {
          this.form.investigatorCount = this.质控组[i].ManagerId;
        }
      }
    },
    handleExpandChange(row, expanded) {
      if (row.TaskGroupId == this.expand_key[0]) {
        this.expand_key = [];
        return;
      }
      this.$post("/Task/GetPageListAsync2?groupid=" + row.TaskGroupId).then(
        (res) => {
          if (expanded) {
            // 如果是展开操作，只保留当前展开行的 key
            this.tableData2 = res.Data;
            this.expand_key = [row.TaskGroupId];
          } else {
            // 如果是收起操作，清空展开行的 key
            this.expand_key = [];
          }
        }
      );
    },
    to_Ti(row) {
      if (this.$route.query.ipad) {
        this.$router.push("/IPAD/Ti_zljc?btn=1&taskDataId=" + row.Id);
      } else {
        this.$router.push("/Ti_zljc?btn=1&taskDataId=" + row.Id);
      }
    },
    to_Ti2(row) {
      if (this.$route.query.ipad) {
        this.$router.push("/IPAD/Ti_zljc?btn=2&taskDataId=" + row.Id);
      } else {
        this.$router.push("/Ti_zljc?btn=2&taskDataId=" + row.Id);
      }
    },
  },
};
</script>

<style scoped lang='scss'>
.init_main {
  background-color: #fff;
  height: calc(100vh - 60px);
  border: 1px solid #333;
  border-radius: 5px;
  margin: 5px;
  padding: 10px;
  font-family: "FangSong";
  color: #000;
  .name_sty {
    color: #000;
    font-weight: 700;
    font-size: 18px;
    font-family: "FangSong";
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
  }
  .table {
    margin-top: 15px;
  }
  .page {
    text-align: right;
  }
}
::v-deep .el-table__body tr.current-row > td.el-table__cell {
  background-color: rgb(208, 229, 250);
  color: rgb(65, 158, 255);
  font-weight: 700;
}
.tac {
  text-align: center;
}
::v-deep .el-textarea.is-disabled .el-textarea__inner {
  color: #000 !important;
}
</style>